﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using csvviewer.contracts;
using csvviewer.logic.data;

namespace csvviewer.logic
{
    public class Parse_lines
    {
        public void Process(PageOfLines page)
        {
            var records = new List<CsvRecord>();
            foreach(var l in page.Lines)
                records.Add(new CsvRecord(){ Values = l.Split(';').ToArray() });
            this.Page(new PageOfRecords{Records=records, PageInfo=page.PageInfo});
        }

        public event Action<PageOfRecords> Page;
    }
}
